﻿<%@ Page Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true" CodeBehind="ZBPayList.aspx.cs"
    EnableEventValidation="false" Inherits="RN.ERP.Web.Pay.ZBPayList" %>

<%@ Register Src="../UserControl/UCArea.ascx" TagName="UCArea" TagPrefix="ucArea" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="Stylesheet" type="text/css" href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.all.js"></script>
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            var ExamDialog = null;
            $(".TransOut").click(function () {
                $("#hidId").val($(this).attr("flag"));
                ShowRemark(0);
                ExamDialog = $.ligerDialog.open({ target: $("#TransOut") });
            });
            $(".Invoice").click(function () {
                $("#hidId").val($(this).attr("flag"));
                ShowRemark(1);
                ExamDialog = $.ligerDialog.open({ target: $("#Invoice") });
            });

            $(".out_class").click(function () {
                AddRemarks($("#hidId").val(), $("#txtRemOut").val(), 0);
            });
            $(".invoice_class").click(function () {
                AddRemarks($("#hidId").val(), $("#txtInvoice").val(), 1);
            });
        })
        function ShowRemark(type) {
            $.ajax({
                url: "ZBPayList.aspx/ShowRemark",
                data: "{ 'id':'" + $("#hidId").val() + "','type':'" + type + "'}",
                type: "post",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    var json = eval('(' + data.d + ')');
                    if (json.Message != "操作失败") {
                        var strs = json.Message.split('&');
                        if (type == 0) {
                            $("#txtRemOut").val(strs[0]);
                            if (strs[1] == "true" || strs[1] == "True") {
                                $("#cbOut").attr("checked", "checked");
                            }
                            else {
                                $("#cbOut").removeAttr("checked");
                            }
                        }
                        else {
                            $("#txtInvoice").val(strs[0]);
                        }
                    }
                }
            });
        }
        function AddRemarks(id, remark, type) {
            var check = $("#cbOut").attr("checked");
            if (check == "undefined" || check == undefined) {
                check = "false";
            }
            $.ajax({
                url: "ZBPayList.aspx/AddRemark",
                data: "{ 'id':'" + $("#hidId").val() + "','type':'" + type + "','check':'" + check + "','remark':'" + remark + "'}",
                type: "post",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    var json = eval('(' + data.d + ')');
                    $.ligerDialog.warn(json.Message, "", RefreshWin);
                    ExamDialog.close();
                }
            });
        }
        function RefreshWin() {
            location.href = location.href;
        }
    </script>
    <style type="text/css">
        .text_css
        {
            border: 2px;
            height: 24px;
            line-height: 24px;
            margin-top: 8px;
        }
        .pad_l6 th
        {
            padding-left: 6px;
            font-weight: bold;
            text-align: center;
        }
        .pad_l6 td
        {
            padding-left: 6px;
        }
        .icon0
        {
            width: 124px;
            height: 53px;
            background: url(../images/icon_bg1.png) right top no-repeat;
            color: #936205;
            font-size: 18px;
            font-weight: bold;
            text-align: center;
            margin: 0 auto;
        }
        .icon0 a
        {
            width: 124px;
            height: 53px;
            line-height: 48px;
            display: block;
            color: #936205;
            font-size: 18px;
            font-weight: bold;
            text-align: center;
        }
        .icon0 a:hover
        {
            text-decoration: none;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
            <td width="19" class="xx_m">
                <img src="../Images/xx_l.jpg" width="19" height="33" />
            </td>
            <td width="24" class="xx_m  tt_xx_icon">
                &nbsp;
            </td>
            <td width="1250" class="xx_m">
                招标文件缴费列表
            </td>
            <td width="14">
                <img src="../Images/xx_r.jpg" width="14" height="33" />
            </td>
        </tr>
        <tr>
            <td class="left_con">
                &nbsp;
            </td>
            <td colspan="2" style="padding-left: 6px; padding-right: 6px;" valign="top">
                <div>
                    <div class="xian">
                        <div class="about_title">
                            招标文件缴费列表</div>
                        <div class="i-con-cn">
                            <span class="xtbiao">
                                <asp:LinkButton ID="lbExport" runat="server" Text="导出表格" OnClick="lbExport_Click"></asp:LinkButton></span>
                            <span class="xtbiao">
                                <asp:LinkButton ID="lbSearch" runat="server" Text="查询" OnClick="lbSearch_Click"></asp:LinkButton></span>
                        </div>
                    </div>
                    <table style="width: 100%; padding-bottom: 10px; background-color: #eaeaea;">
                        <tr>
                            <td width="80" style="padding-left: 10px;">
                                代理名称：
                            </td>
                            <td style="text-align: left;">
                                <asp:TextBox ID="txtCorpDl" runat="server" CssClass="text_css"></asp:TextBox>
                            </td>
                            <td width="90">
                                项目名称：
                            </td>
                            <td style="text-align: left;">
                                <asp:TextBox ID="txtProject" runat="server" CssClass="text_css"></asp:TextBox>
                            </td>
                            <td width="100">
                                缴费时间：
                            </td>
                            <td style="text-align: left;">
                                <asp:TextBox ID="txtBegin" runat="server" CssClass="text_css" onclick="WdatePicker({skin:'blue'})"></asp:TextBox>
                            </td>
                            <td>
                                <span style="padding: 0 5px;">至</span>
                                <asp:TextBox ID="txtEnd" runat="server" CssClass="text_css" onclick="WdatePicker({skin:'blue'})"></asp:TextBox>
                            </td>
                        </tr>
                        <tr style="height: 50px;">
                            <td style="padding-left: 10px;">
                                订单编号：
                            </td>
                            <td style="text-align: left;">
                                <asp:TextBox ID="txtOrdID" runat="server" CssClass="text_css"></asp:TextBox>
                            </td>
                            <td width="100">
                                报名企业：
                            </td>
                            <td style="text-align: left;">
                                <asp:TextBox ID="txtCorpBm" runat="server" CssClass="text_css"></asp:TextBox>
                            </td>
                            <td>
                                地区：
                            </td>
                            <td style="text-align: left; padding-bottom: 8px; width: 100px;">
                                <ucArea:UCArea ID="ucArea" Name="ucArea" runat="server" />
                            </td>
                            <td>
                                已转帐：
                                <asp:DropDownList ID="ddlProcess" runat="server" Height="25" Width="80">
                                    <asp:ListItem Value="-1">请选择</asp:ListItem>
                                    <asp:ListItem Value="true">是</asp:ListItem>
                                    <asp:ListItem Value="false">否</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound"
                        AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" Width="100%"
                        PageSize="15" AllowSorting="True" ShowFooter="True" EnableModelValidation="True"
                        HeaderStyle-Height="30" AlternatingRowStyle-BackColor="#F2F2F2" CssClass="pad_l6">
                        <Columns>
                            <asp:BoundField DataField="CorpName" HeaderText="代理机构" HeaderStyle-Width="12%" />
                            <asp:TemplateField HeaderText="代理账号" HeaderStyle-Width="17%">
                                <ItemTemplate>
                                    <%#Eval("BankName")%><br />
                                    <%#Eval("BankAccName")%><br />
                                    <%#Eval("BankAccNo")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Title1" HeaderText="项目地" HeaderStyle-Width="5%" />
                            <asp:BoundField DataField="ProjectName" HeaderText="工程项目(标段)" HeaderStyle-Width="12%" />
                            <asp:BoundField DataField="CorpName1" HeaderText="报名企业" HeaderStyle-Width="11%" />
                            <asp:BoundField DataField="OrderID" HeaderText="银联订单" HeaderStyle-Width="10%" />
                            <asp:BoundField DataField="PayMoney" HeaderText="金额(元)" HeaderStyle-Width="5%" />
                            <asp:BoundField DataField="OptDate" HeaderText="缴费时间" HeaderStyle-Width="10%" />
                            <asp:TemplateField HeaderText="转出(元)" HeaderStyle-Width="5%">
                                <ItemTemplate>
                                    <%# int.Parse(Eval("PayMoney").ToString()) > 150 ? (int.Parse(Eval("PayMoney").ToString()) - 150).ToString() : ""%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="是否转账" HeaderStyle-Width="8%">
                                <ItemTemplate>
                                    <a style="cursor: pointer; color: red;">
                                        <asp:Label ID="lbOut" CssClass="TransOut" runat="server" Text="转账" flag='<%#Eval("ID") %>'></asp:Label></a><br />
                                    (<%#Eval("FinanceProcessed") != null && bool.Parse(Eval("FinanceProcessed").ToString()) ? "已转账" : "未转账"%>)
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="备注" ItemStyle-Width="80px">
                                <ItemTemplate>
                                    <a style="cursor: pointer; color: red;">
                                        <asp:Label ID="lbInvoice" CssClass="Invoice" runat="server" Text="开发票" flag='<%#Eval("ID") %>'></asp:Label></a><br />
                                    <%#Eval("FinanceRemark") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="#F2F2F2" />
                    </asp:GridView>
                    <table width="100%" style="font-size: 15px; font-weight: bold;">
                        <tr>
                            <td style="text-align: right">
                                第<asp:Label ID="lblPageIndex" runat="server"></asp:Label>页 /共<asp:Label ID="lblPageCount"
                                    runat="server"></asp:Label>页&nbsp;&nbsp;
                                <asp:LinkButton ID="btnFirst" runat="server" CausesValidation="False" CommandName="Page"
                                    Text="首页" CommandArgument="first" OnClick="btnFirst_Click">
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnPrev" runat="server" CausesValidation="False" CommandName="Page"
                                    Text="上一页" CommandArgument="prev" OnClick="btnFirst_Click">
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnNext" runat="server" CausesValidation="False" CommandName="Page"
                                    Text="下一页" CommandArgument="next" OnClick="btnFirst_Click">
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnLast" runat="server" CausesValidation="False" CommandName="Page"
                                    Text="尾页" CommandArgument="last" OnClick="btnFirst_Click">
                                </asp:LinkButton>
                                <span style="padding-left: 5px;">共<asp:Label ID="lbCount" runat="server"></asp:Label>条</span>
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
            <td class="right_con">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="con_m tt_left_bottom">
                &nbsp;
            </td>
            <td colspan="2" class="con_m">
                &nbsp;
            </td>
            <td class="tt_right_bottom">
                &nbsp;
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hidPay" runat="server" />
    <asp:HiddenField ID="hidOut" runat="server" />
    <asp:HiddenField ID="hidPageCount" runat="server" />
    <asp:HiddenField ID="hidPageIndex" runat="server" Value="0" />
    <asp:HiddenField ID="hidPageSize" runat="server" Value="15" />
    <asp:HiddenField ID="hidId" runat="server" ClientIDMode="Static" />
    <div id="TransOut" style="margin: 3px; display: none;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab" style="margin-bottom: 15px;">
            <tr>
                <td>
                    备注：
                </td>
                <td>
                    <asp:TextBox ID="txtRemOut" runat="server" CssClass="text_css" ClientIDMode="Static"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    是否转账：
                </td>
                <td>
                    <asp:CheckBox ID="cbOut" runat="server" Checked="false" ClientIDMode="Static" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="icon0">
                        <a href="javascript:void(0);" class="out_class">确定</a>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div id="Invoice" style="margin: 3px; display: none;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab" style="margin-bottom: 15px;">
            <tr>
                <td>
                    发票号：
                </td>
                <td>
                    <asp:TextBox ID="txtInvoice" runat="server" CssClass="text_css" ClientIDMode="Static"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="icon0">
                        <a href="javascript:void(0);" class="invoice_class">确定</a>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
